/*
 * Created on Jul 19, 2005
 *
 */
package org.mushroomdb.server;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * @author Matu
 *
 */
public class Stop {
	private final static String SHUTDOWN_MESSAGE = "<shutdown/>"; //$NON-NLS-1$

	public static void main(String[] args) {
		try {
			Socket socket = new Socket("localhost",44445); //$NON-NLS-1$
			OutputStreamWriter writer = new OutputStreamWriter(socket.getOutputStream());
			writer.write(SHUTDOWN_MESSAGE);
			writer.close();
		} catch (UnknownHostException e) {
			e.printStackTrace();
			System.exit(1);
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
